<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>享送小哥</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
</head>

<body>
    <div class="aui-content aui-margin-b-15 vue">
        <div class="login-t1"></div>
        <ul class="aui-list aui-form-list aui-form-list2 aui-border-b aui-border-t">
            <li class="aui-list-item aui-padded-l-5">
                <div class="aui-list-item-inner bor-bn">
                    <div class="aui-list-item-input">
                        <input placeholder="请输入修改的昵称" type="text" class="u-inp1" v-model="name">
                    </div>
                </div>
            </li>
        </ul>
        <input class="aui-btn aui-btn-info login-sub2 mt40" type="submit" value="确定" @click="submit">
    </div>
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/vue.js"></script>
    <script type="text/javascript" src="../script/app.js"></script>
    <script type="text/javascript">
        apiready = function() {
            new Vue({
                el: ".vue",
                data: {
                    name: api.pageParam.name
                },
                methods: {
                    submit: function() {
                        var name = this.name;
                        app.request.post('Client/setUserInfo', {
                            type: 'name',
                            name: name
                        }, {}, function(res) {
                            if (res.code == 200) {
                                api.sendEvent({
                                    name: 'waitSetNameResult',
                                    extra: name
                                });
                                api.closeWin({
                                    name: 'set_name'
                                })
                            } else {
                                app.error(res.message);
                            }
                        })
                    }
                }
            })
        }
    </script>
</body>

</html>
